package com.dk.service.content;

import com.alibaba.dubbo.config.annotation.Service;
import com.dk.mapper.content.TbContentCategoryMapper;
import com.dk.pojo.content.TbContentCategory;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.List;

@Service
@Component
public class ContentCategoryServiceImpl implements ContenCategoryService {

    @Resource
    private TbContentCategoryMapper contentCategoryMapper;

    @Override
    public int updateCate(TbContentCategory category) {
        return contentCategoryMapper.updateByPrimaryKeySelective(category);
    }

    @Override
    public TbContentCategory cateById(Long id) {
        return contentCategoryMapper.selectByPrimaryKey(id);
    }

    @Override
    public int saveCate(TbContentCategory category) {
        return contentCategoryMapper.insertSelective(category);
    }

    @Override
    public List<TbContentCategory> listContentCate() {
        return contentCategoryMapper.selectByExample(null);
    }
}
